import time
# from selenium import webdriver
class Common():
    def __init__(self, driver):
        self.driver = driver

    def findElement(self,byWay,wayAttribute):
        if byWay == 'ID':
            return self.driver.find_element_by_id(wayAttribute)
        elif byWay == 'Xpath':
            return self.driver.find_element_by_xpath(wayAttribute)
        elif byWay == 'Css':
            return self.driver.find_element_by_css_selector(wayAttribute)
        elif byWay == 'Name':
            return self.driver.find_element_by_name(wayAttribute)
        elif byWay == 'Text':
            return self.driver.find_element_by_link_text(wayAttribute)
        elif byWay == 'Part_text':
            return self.driver.find_element_by_partial_link_text(wayAttribute)
        elif byWay == 'Class':
            return self.driver.find_element_by_class_name()(wayAttribute)
